Basic analysis of Vancouver weather patterns:
Data is collected from Govt of Canada website:
(process is automated in ‘van-weather-import.R’)
## [1] "Winter" "Spring" "Summer" "Fall"
Earliest date: 1988-01-01
Most recent date: 2020-03-07
Check data structure:
## Classes 'spec_tbl_df', 'tbl_df', 'tbl' and 'data.frame': 11752 obs. of 10 variables:
## $ Month : Factor w/ 12 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Season : Factor w/ 4 levels "Winter","Spring",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Date : Date, format: "1988-01-01" "1988-01-02" ...
## $ Year : Factor w/ 33 levels "1988","1989",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Day : num 1 2 3 4 5 6 7 8 9 10 ...
## $ Max.Temp : num 3.2 2.5 5.2 3.3 4.3 4.5 5.7 5 6.8 7 ...
## $ Min.Temp : num -0.9 -2 -1.5 0 1.7 1.7 2.7 1.2 2.1 4.7 ...
## $ Mean.Temp : num 1.2 0.3 1.9 1.7 3 3.1 4.2 3.1 4.5 5.9 ...
## $ Total.Precip: num 0 0 0 0 0 0 0 5.6 2.4 0 ...
## $ Season.Yr : num 1988 1988 1988 1988 1988 ...
## - attr(*, "spec")=
## .. cols(
## .. Month = col_double(),
## .. Season = col_character(),
## .. Date = col_date(format = ""),
## .. Year = col_double(),
## .. Day = col_double(),
## .. Max.Temp = col_double(),
## .. Min.Temp = col_double(),
## .. Mean.Temp = col_double(),
## .. Total.Precip = col_double(),
## .. Season.Yr = col_double()
## .. )
Earliest date: 1988-01-01
Most recent date: 2020-03-07
Check Data Relationships
For each month, what has been the pattern in precipitation over the years?
Note: the year for a winter season is applied to year at end of season. So winter from Dec 2018 to Feb 2019 is considered winter of 2019.
##
## Call:
## lm(formula = mean.mean ~ ynum, data = vw.temp.yr)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.06271 -0.44340 -0.01888 0.45964 1.06865
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 16.560090 25.469955 0.650 0.522
## ynum -0.002517 0.012706 -0.198 0.845
##
## Residual standard error: 0.5623 on 24 degrees of freedom
## Multiple R-squared: 0.001632, Adjusted R-squared: -0.03997
## F-statistic: 0.03923 on 1 and 24 DF, p-value: 0.8447
Model interpretation:
Linear modelling for max and min
##
## Call:
## lm(formula = mean.max ~ ynum, data = vw.temp.yr)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.22083 -0.36492 -0.06269 0.44222 1.23017
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 17.572393 28.058085 0.626 0.537
## ynum -0.001481 0.013997 -0.106 0.917
##
## Residual standard error: 0.6195 on 24 degrees of freedom
## Multiple R-squared: 0.0004662, Adjusted R-squared: -0.04118
## F-statistic: 0.01119 on 1 and 24 DF, p-value: 0.9166
Model interpretation:
##
## Call:
## lm(formula = mean.min ~ ynum, data = vw.temp.yr)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.89858 -0.43410 0.00637 0.48331 0.86790
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 13.705786 24.941836 0.550 0.588
## ynum -0.002663 0.012443 -0.214 0.832
##
## Residual standard error: 0.5507 on 24 degrees of freedom
## Multiple R-squared: 0.001905, Adjusted R-squared: -0.03968
## F-statistic: 0.0458 on 1 and 24 DF, p-value: 0.8324
Model interpretation:
For each month, what has been the pattern in ave. temperature over the years?
Note: the year for a winter season is applied to year at end of season. So winter from Dec 2018 to Feb 2019 is considered winter of 2019.